import { createElement, createTextNode, mount,patch } from './vdom';
const oldVnode = createElement('div',{
    id:"container",style:{color:'red'},class:'oldBg'
},
createElement('span',{},createTextNode('hello')),
createTextNode('world'));
const app = document.querySelector('#app');
mount(app, oldVnode);
document.querySelector('#existOldChildren')
.addEventListener('click', () => {
    const newVnode = createElement('div',{
        id:"container",style:{color:'red'},class:'oldBg'
    });
    patch(oldVnode,newVnode);
});